import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';
import 'package:finance_app/src/entities/ocr_attachment_entity.dart';

class JournalEntryDetailEntity with JsonConvert<JournalEntryDetailEntity> {
  int id;
  @JSONField(name: "company_id")
  int companyId;
  String number;
  @JSONField(name: "ref_number")
  String refNumber;
  @JSONField(name: "transaction_id")
  int transactionId;
  @JSONField(name: "transaction_type")
  String transactionType;
  @JSONField(name: "journal_ref_id")
  int journalRefId;
  String currency;
  int amount;
  @JSONField(name: "default_currency")
  String defaultCurrency;
  @JSONField(name: "default_amount")
  int defaultAmount;
  int rate;
  dynamic memo;
  String date;
  String status;
  @JSONField(name: "deleted_at")
  String deletedAt;
  @JSONField(name: "add_from")
  String addFrom;
  List<JournalEntryDetailJournalDetail> journalDetail;
  List<OcrAttachmentEntity> attachments; //depreciated
  @JSONField(name: "attachments_info")
  List<OcrAttachmentEntity> attachmentsInfo;
}

class JournalEntryDetailJournalDetail
    with JsonConvert<JournalEntryDetailJournalDetail> {
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "journal_id")
  int journalId;
  @JSONField(name: "coa_account_detail_id")
  int coaAccountDetailId;
  @JSONField(name: "coa_account_detail_name")
  String coaAccountDetailName;
  @JSONField(name: "crdr_nature")
  String crdrNature;
  @JSONField(name: "f_currency")
  String fCurrency;
  @JSONField(name: "f_dr_amount")
  int fDrAmount;
  @JSONField(name: "f_cr_amount")
  int fCrAmount;
  String currency;
  @JSONField(name: "dr_amount")
  num drAmount;
  @JSONField(name: "cr_amount")
  num crAmount;
  int displayBalance;
}
